home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Controls
/
Visual Basic Controls.iso
/
vbcontrol
/
intmail2
/
pop2main.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-07-21
|
2KB
|
69 lines
unit Pop2Main;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, msmsg, Mssocket, Mspop, ComCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
ServerEdit: TEdit;
UserNameEdit: TEdit;
PasswordEdit: TEdit;
BodyMemo: TMemo;
msPOPClient1: TmsPOPClient;
msMessage1: TmsMessage;
RetrieveButton: TButton;
procedure RetrieveButtonClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.RetrieveButtonClick(Sender: TObject);
var
i: Integer;
Found: boolean;
begin
msPOPClient1.Host:=ServerEdit.Text;
msPOPClient1.UserName:=UserNameEdit.Text;
msPOPClient1.Password:=PasswordEdit.Text;
msPOPClient1.Login;
if msPOPClient1.TotalMessages>0 then
begin
Found:=false;
for i:=0 to msPOPClient1.TotalMessages-1 do
begin
msPOPClient1.CurrentMessage:=i;
msPOPClient1.RetrieveHeaders;
Found:=Pos('camping',LowerCase(msMessage1.Subject))>0;
if Found then Break;
end;
if Found then
begin
msPOPClient1.CurrentMessage:=i;
msPOPClient1.Retrieve;
BodyMemo.Lines:=msMessage1.Body;
end
else
ShowMessage('Message not found');
end
else
ShowMessage('There are no messages');
msPOPClient1.Logout;
end;
end.